<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>快速上手 | VueDialog</title>
    <meta name="generator" content="VuePress 1.8.2">
    
    <meta name="description" content="函数式vue弹框组件">
    
    <link rel="preload" href="/assets/css/0.styles.cc89e670.css" as="style"><link rel="preload" href="/assets/js/app.788a47ea.js" as="script"><link rel="preload" href="/assets/js/2.7e7556ec.js" as="script"><link rel="preload" href="/assets/js/13.ac599485.js" as="script"><link rel="prefetch" href="/assets/js/10.b84ad5d4.js"><link rel="prefetch" href="/assets/js/11.fc2c4f3c.js"><link rel="prefetch" href="/assets/js/12.9c54e5b5.js"><link rel="prefetch" href="/assets/js/14.1e4ace2f.js"><link rel="prefetch" href="/assets/js/15.39a933fd.js"><link rel="prefetch" href="/assets/js/3.c3e77ff5.js"><link rel="prefetch" href="/assets/js/4.23df146b.js"><link rel="prefetch" href="/assets/js/5.8e9108c5.js"><link rel="prefetch" href="/assets/js/6.16373f7f.js"><link rel="prefetch" href="/assets/js/7.fd48b8cc.js"><link rel="prefetch" href="/assets/js/8.bb0177c6.js"><link rel="prefetch" href="/assets/js/9.c3c48dac.js">
    <link rel="stylesheet" href="/assets/css/0.styles.cc89e670.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/assets/logo.png" alt="VueDialog" class="logo"> <span class="site-name can-hide">VueDialog</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">
  首页
</a></div><div class="nav-item"><a href="/zh/guide/example/" class="nav-link">
  快速开始
</a></div><div class="nav-item"><a href="/zh/guide/api/" class="nav-link">
  API
</a></div><div class="nav-item"><a href="/zh/guide/api/" class="nav-link">
  在线Demo
</a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">
  首页
</a></div><div class="nav-item"><a href="/zh/guide/example/" class="nav-link">
  快速开始
</a></div><div class="nav-item"><a href="/zh/guide/api/" class="nav-link">
  API
</a></div><div class="nav-item"><a href="/zh/guide/api/" class="nav-link">
  在线Demo
</a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/zh/guide/start/" aria-current="page" class="active sidebar-link">快速开始</a></li><li><a href="/zh/guide/start/option.html" class="sidebar-link">option配置</a></li><li><a href="/zh/guide/start/defaultOption.html" class="sidebar-link">option默认值</a></li></ul></section></li><li><a href="/zh/guide/api/" class="sidebar-link">API</a></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>示例</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/zh/guide/example/" class="sidebar-link">代码示例</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>联系我们</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/zh/guide/our/" class="sidebar-link">联系我们</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="快速上手"><a href="#快速上手" class="header-anchor">#</a> 快速上手</h1> <hr> <h1 id="安装"><a href="#安装" class="header-anchor">#</a> 安装</h1> <div class="language-javascript extra-class"><pre class="language-javascript"><code>npm install vue<span class="token operator">-</span>pubilc<span class="token operator">-</span>layer <span class="token operator">-</span>s
</code></pre></div><hr> <h1 id="main-js引入"><a href="#main-js引入" class="header-anchor">#</a> main.js引入</h1> <div class="language-javascript extra-class"><pre class="language-javascript"><code><span class="token keyword">import</span> layer <span class="token keyword">from</span> <span class="token string">'vue-pubilc-layer'</span>
Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>layer<span class="token punctuation">,</span>option<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//option 详细信息见option文档</span>
</code></pre></div><h1 id="使用示例"><a href="#使用示例" class="header-anchor">#</a> 使用示例</h1> <div class="language-javascript extra-class"><pre class="language-javascript"><code>vm<span class="token punctuation">.</span>$layer<span class="token punctuation">.</span><span class="token function">open</span><span class="token punctuation">(</span>option<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//option 详细信息见option文档</span>
</code></pre></div><hr> <h1 id="option配置优先级说明"><a href="#option配置优先级说明" class="header-anchor">#</a> option配置优先级说明</h1> <div class="language-javascript extra-class"><pre class="language-javascript"><code>Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>layer<span class="token punctuation">,</span>option<span class="token punctuation">)</span> <span class="token comment">//此配置为全局配置，优先级低</span>
vm<span class="token punctuation">.</span>$layer<span class="token punctuation">.</span><span class="token function">open</span><span class="token punctuation">(</span>option<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">//此配置为个性化配置，优先级高</span>
</code></pre></div><hr></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><!----> <span class="next"><a href="/zh/guide/start/option.html">
        option配置
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/assets/js/app.788a47ea.js" defer></script><script src="/assets/js/2.7e7556ec.js" defer></script><script src="/assets/js/13.ac599485.js" defer></script>
  </body>
</html>
